package com.cdd.index.controller;

import com.cdd.index.service.IHeadNavService;
import com.cdd.index.service.IZoneService;
import com.common.entity.HeadNav;
import com.common.entity.Zone;
import com.common.untils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 专区 前端控制器
 * </p>
 *
 * @author lzl
 * @since 2022-09-02
 */
@RestController
@RequestMapping("/index/zone")
public class ZoneController {
    @Autowired
    private IZoneService zoneService;
    @PostMapping("/selectAll/{currentPage}/{pageSize}")
    public CommonResult selectAll(@PathVariable Integer currentPage, @PathVariable Integer pageSize, @RequestBody Zone zone){
        return zoneService.selectAll(currentPage,pageSize,zone);
    }
    @PostMapping("/findAll")
    public CommonResult findAll(){
        return zoneService.findAll();
    }


    @PostMapping("/zoneAdd")
    public CommonResult zoneAdd(@RequestBody Zone zone){
        return zoneService.zoneAdd(zone);
    }
    @PostMapping("/deleteZone/{id}")
    public CommonResult deleteZone(@PathVariable String id){
        return zoneService.deleteZone(id);
    }

    @PostMapping("/updateStatus/{id}/{isDisable}")
    public CommonResult updateStatus(@PathVariable String id,@PathVariable Integer isDisable){
        return zoneService.updateStatus(id,isDisable);

    }
    @PostMapping("getAllZone")
    public CommonResult getAllZone(){
        return zoneService.getAllzone();
    }





}
